import { VmpEntity, VmpMemberEntity } from '../vmp/interface'
import requestMeeting, { request } from '@/plugins/axios'
import { AutoVmpData, ChairmanVmpData } from './interface'
/** 查询自主多画面数据 */
export const fetchGetMtVmpParam = async (meeting_moid: string, mt_id: string) =>
	requestMeeting<VmpEntity>({
		url: `/mcc/${meeting_moid}/mtvmps/${mt_id}`,
		method: 'get',
	}).then((res) => res)

export const fetchStartMTVmp = async (meeting_moid: string, data: AutoVmpData | ChairmanVmpData) =>
	requestMeeting({
		url: `/mcc/${meeting_moid}/mtvmps`,
		method: 'post',
		data: data,
	}).then((res) => res)

/** 修改自动多画面 */
export const fetchChangeMTVmp = async (meeting_moid: string, mt_id: string, data: AutoVmpData | ChairmanVmpData) =>
	requestMeeting({
		url: `/mcc/${meeting_moid}/mtvmps/${mt_id}`,
		method: 'put',
		data: data,
	}).then((res) => res)

/** 停止自动多画面 */
export const fetchStopMTVmp = async (meeting_moid: string, mt_id: string) =>
	requestMeeting({
		url: `/mcc/${meeting_moid}/mtvmps/${mt_id}`,
		method: 'delete',
	}).then((res) => res)

/** 获取单通道轮询信息 */
export const fetchGetMtVmpSinglePoll = async (meeting_moid: string, mt_id: string) =>
	request<{ list: VmpMemberEntity[] }>({
		url: `/mcc/${meeting_moid}/mtvmps/${mt_id}/members/poll`,
		method: 'get',
	}).then((res) => res)
